<?php
declare (strict_types = 1);

namespace app\middleware;
use think\helper\Str;
use think\facade\Config;
use think\facade\Cache;
use think\facade\Db;

class SiteMiddleware
{
    /**
     * 后台权限判断中间件
     *
     * @param \think\Request $request
     * @param \Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        try {

            $header = $request->header();

        } catch (ValidateException $e) {
            // 验证失败 输出错误信息
            
            return error($e->getError());
        }
        
        return $next($request);
    }
}
